/*
 * @Author: ZhanXie
 * @Date: 2020-08-11 12:12:12
 * @LastEditors: ZhanXie
 * @LastEditTime: 2020-09-13 21:19:11
 * @Description: Sequelize 同步数据库
 * @FilePath: /weibo/src/db/sync.js
 */
const seq = require('./seq')

require('./model/index')

!(async () => {
  try {
    // 测试连接
    await seq.authenticate()
    console.log('auth ok')
    await seq.sync({ force: true })
    // await seq.sync()
    console.log('sync ok')
    process.exit()
  } catch (error) {
    console.log('同步失败', error)
  }
})()